<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>护士站（调整床位，执行医嘱，拿药）</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/metro/easyui.css"/>
<link rel="stylesheet" href="static/easyui/themes/icon.css"/>
</head>
<body>
	<script type="text/javascript">
//库存
var kucuns=function(value,row,index){
	var drug_id=row.drug_number;
	var storages="";
	$.ajax({
		url:'selectInhospital_storage',
		type:'post',
		async:false,
		data:{
			"drug_number":drug_id
		},
		success:function(data){
			for (var i = 0; i < data.length; i++) {
				storages+="<a>"+data[i].inhosp_samallstorage+"</a>";
			}
		}
	});
	return storages;
}
	
	//指定一个事件来扣除每天的床位费
	var timeTask=setInterval(function(){
        var date=new Date();
        var h=date.getHours();
        var m=date.getMinutes();
        var s=date.getSeconds();
        if(h==10 && m==0 && s==0){
             callFunction();
        }
    },1000);
	
    function callFunction(){
        var bedrows =  $("#bed-changebed-record-dg").datagrid("getRows");
		for (var i = 0; i < bedrows.length; i++) {
			var hospidday = bedrows[i].days;
	        if(hospidday>=1){
				//住院号
				var hospid = bedrows[i].hosp_id;
				var money = bedrows[i].bed_money;
				 $.ajax({
			   		url:'deduck-cashmoney',
			   		type:'post',
			   		data:{'hospid':hospid,'money':money},
	                dataType:"json",
			   		success:function(data){
			   			$(".window-applydrug").text(data.result);
				    	$("#warmingapplydurg-win").window('open');
				    	//三秒之后自动消失
					    setTimeout(function(){
					    	 $("#warmingapplydurg-win").window('close');
						}, 3000);
			   		}
			   	}); 
			}
		}
    }
    	//编辑表格
		 function updateActions(index) {
				 $("#recipe-dg").datagrid('updateRow', {
				        index: index,
				        row: {}
				 });
				 var rows = $("#recipe-dg").datagrid("getRows");
				 var row = rows[index];
				  
		}
		//设置	
		function editrow(index) {
			   $('#bj' + index).hide();
			   $('#bc' + index).show();
			   $('#qx' + index).show();
			   //启动编辑
			   $("#recipe-dg").datagrid('beginEdit', index);
			   globalIndex =index;
			   $("#recipe-dg").datagrid("selectRow",globalIndex);
			   var row=	$("#recipe-dg").datagrid("getSelected"); 
		}
		//保存
	    function saverow(index) {
			//获取表格的行
	    	var rows2 = $("#recipe-dg").datagrid("getRows");
	    	//获取这一行的值
	    	var lbed = $("#recipe-dg").datagrid('getEditor', 
					{index:index,field:'zcount'});
	    	
	        var lbcode = $(lbed.target).numberbox('getValue');
	        
			if(lbcode == null || lbcode == '' ){
				$.messager.alert('提示','数量不能为空','info');
				return ;
			}
			var oldcount = rows2[index].zcount;
			if(lbcode<1){
				$.messager.alert('提示','数量不能小于1','info');
				return ;
			}
			
		    var kucun = rows2[index].zkucun;
			if(kucun<lbcode){
				$.messager.alert('提示','药品数量不能大于库存数量','info');
				return ;
			}
			//结束编辑
			$("#recipe-dg").datagrid('endEdit', index);

			 var totalcount=0;
			 var totalm=0;
			 for (var i = 0; i < rows2.length; i++) {
				totalcount = totalcount + parseInt(rows2[i].zcount);
				totalm = totalm + parseInt(rows2[i].zcount)*parseInt(rows2[i].drug_purchase_price);
			}
			 $("#totalcount").textbox("setValue",totalcount);
			 $("#totalmoney").textbox("setValue",totalm);
	    }
	
	    //取消
	    function cancelrow(index) {
	    	 $("#recipe-dg").datagrid('cancelEdit',index);
	    	 var tcount = $("#recipe-dg").datagrid("getRows");
			 var totalcount=0;
			 var totalm=0;
			 for (var i = 0; i < tcount.length; i++) {
				var row = tcount[i];
				totalcount = totalcount + parseInt(row.zcount);
				totalm = totalm + parseInt(row.zcount)*parseInt(row.drug_purchase_price);
			 }
			 $("#totalcount").textbox("setValue",totalcount);
			 $("#totalmoney").textbox("setValue",totalm);
	    }

		$(function(){
			//搜索医疗卡号
			$("#addapplydurg").click(function(){
				$("#recipe-dg").datagrid({
					url : 'init-selectAdvice',
					onLoadSuccess: function (data) { 
						if(data==null||data.total ==0){
							$(this).datagrid('appendRow',{
								        docdetails_id:'<div style="height:50px;font-size:22px;text-align:center;color:red;line-height:50px;">没有相关记录！</div>',
										rownumbers : false
								//合并单元格
							}).datagrid('mergeCells',{
										index : 0,
										field : 'docdetails_id',
										colspan : 8
							})
							//隐藏分页导航条
							$(this).closest('div.datagrid-wrap').find('div.datagrid-pager').hide();
						}else{
							$(this).closest('div.datagrid-wrap').find('div.datagrid-pager').show();
						}
		
					}, 
					columns : [[ 
						{field:'docdetails_id',title:'处方号',width:130},
						{field:'hosp_id',title:'住院号',width:173,hidden:true},
						{field:'drug_name',title:'药物名称',width:131},
						{field:'drug_purchase_price',title:'价格',width:131},
						{field:'zkucun',title:'库存',width:131},
						{field:'zcount',title:'数量',width:131,editor:'numberbox'},
						{field:'type_name',title:'类别',width:131},
					    {field:'subtotal',title:'小计',width:131,
							formatter:function(value,row,index){
							 var count = row.zcount;
							 var price = row.drug_purchase_price;
							 var subtotal = parseInt(price)*parseInt(count);
	   						 $("#totalmoney").textbox("setValue",parseInt($("#totalmoney").val())+parseInt(subtotal));
	   						 $("#totalcount").textbox("setValue",parseInt($("#totalcount").val())+parseInt(count));
	   						 $("#sickname").textbox("setValue",row.clinic_name);
	   						 return subtotal;
	   					   }
						},
						{field:'opt',title:'操作',width:131,
							 formatter:function(value,row,index){  
			            	     var btn = '<a href="#" id="bj'+index+'" onclick="editrow(\''+index+'\');">设置</a> '
			            	        + '<a href="#"  id="bc'+index+'" style="display:none" onclick="saverow(\''+index+'\');">保存</a>'
			            	        + '<span></span><a href="#"  id="qx'+index+'" style="display:none" onclick="cancelrow(\''+index+'\');">取消</a>'; 
			                	 return btn;  
							}   
						} 
					]] ,
				    onBeforeEdit: function (index, row) {
				        row.editing = true;
				        updateActions(index);
				    },
				    onAfterEdit: function (index, row) {
				        row.editing = false;
				        updateActions(index);
				    },
				    onCancelEdit: function (index, row) {
				        row.editing = false;
				        updateActions(index);
				    }
				});
			});	
		
			
			
			//点击领药的确定按钮
			$("#apply-drug-comfirm").click(function(){
				$("<form method='Post' id='for'>").appendTo("body").form({
					url:'add-applydrug',
					onSubmit:function(param){
						//获取发药类型状态
						param["publicdurg.publicdurgType"] = 1;
						//领药人
						param["publicdurg.publicdurgLingyaopeople"] =$("#apply-nurseuname").val();						
						//总数量
						param["publicdurg.publicdurgShuliang"] =$("#totalcount").val();
						//总金额
						param["publicdurg.publicdurgAllmoney"] = $("#totalmoney").val();
						//获取表格中的发药的记录
						var rows = $("#recipe-dg").datagrid("getRows");
						for(var  i = 0;i < rows.length; i++){
							//医嘱详情的主键
							param["publicdurgdetail["+i+"].doctoradviceDetail.docdetailsId"] = rows[i]["docdetails_id"];
							param["publicdurgdetail["+i+"].pdDetailsSjcount"]=0;
							param["publicdurgdetail["+i+"].pdDetailsShuliang"] = rows[i]["zcount"];
						}	
							
					},
					success:function(date){
						var  rows =$("#recipe-dg").datagrid("getRows");
						if(rows){
							for (var i = rows.length-1; i >= 0; i--) {
								var index = $("#recipe-dg").datagrid('getRowIndex',rows[i]);
								$("#recipe-dg").datagrid('deleteRow',index);
							}
						}
				    	$.messager.show({
	                        title:'提示信息' , 
	                        msg:'领药'+date+'，请药房及时发药!'
	                    });
						
					}
			   }).submit();
		 });
		//药单的信息
		$("#recipe-dg").datagrid({
		    url:'',
		    columns:[[
				{field:'docdetails_id',title:'处方号',width:130},
				{field:'hosp_id',title:'住院号',width:173,hidden:true},
				{field:'drug_name',title:'药物名称',width:131},
				{field:'drug_purchase_price',title:'价格',width:131},
				{field:'zkucun',title:'库存',width:131},
				{field:'zcount',title:'数量',width:131},
				{field:'type_name',title:'类别',width:131},
			    {field:'subtotal',title:'小计',width:131},
				{field:'opt',title:'操作',width:131} 
		    ]]
		});
	
			//未执行的医嘱信息
			$("#notexecute_advice_dg").datagrid({
			    url:'find-notadviceall',
			    method:'Post',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:10,
      		    pageList:[10,20],
			    columns:[[
			    	{field:'docdetails_id',title:'处方编号',width:75},
			    	{field:'hosp_id',title:'住院号',width:100,hidden:true},
			    	{field:'clinic_name',title:'病人姓名',width:75},
			    	{field:'user_name',title:'主治医生',width:90},
					{field:'drug_name',title:'药物名称',width:130},
					{field:'drug_purchase_price',title:'价格',width:60},
					{field:'docdetails_everynnum',title:'领药药品数量',width:90},
					{field:'docdetails_hz',title:'药品用量',width:140,
						formatter:function(value,row,index){
							 return "一天  "+value+" 瓶";
	   					},
						styler: function(value,row,index){
							return 'color:blue;font-weight:bold;';
					    }
	   				},
					{field:'type_name',title:'类别',width:80},
			    	{field:'drug_number',title:'药物编号',width:150,hidden:true},
					{field:'kucun',title:'库存',width:90,
						styler: function(value,row,index){
							return 'color:red;';
						},
						formatter:kucuns
					},
					{field:'sate',title:'状态',width:90,
						formatter:function(value,row,index){
							if(row.kucun==0){
								 return "待发药";
							}else if(row.kucun !=0){
								return "库存充足";
							}  
	   					},
						styler: function(value,row,index){
							if(row.kucun==0){
								return 'color:red;';
							}
						}
					},
					{field:'publicdurg_type',title:'发药编号',width:150,hidden:true},
					{field:'pd_details_sjcount',title:'实际发药数量',width:90,hidden:true},
					{field:'mops',title:'操作',width:128,
   					   formatter:function(value,row,index){
   						   if(row.kucun==0){
   							   var btn ='<a class="tixing" onclick="remind()" href="javascript:void(0)">提醒发药</a>';
     						   return btn;
   						   }else if(row.kucun != 0){
   							   var btn ='<a class="detials" onclick="executeadice(\''+row.docdetails_id+'\',\''+row.hosp_id+'\',\''+row.clinic_name+'\',\''+row.user_name+'\',\''+row.docdetails_everynnum+'\',\''+row.kucun+'\',\''+row.drug_number+'\')" href="javascript:void(0)">执行</a>';
     						   return btn;
   						   }
			              
   					   } 
	   				}
			    ]],
				onLoadSuccess:function(data){
			        $('.detials').linkbutton({
			        	text:'执行',
			        	plain:true,
			        	iconCls:'icon-edit'
			        });
			        
			        $('.tixing').linkbutton({
			        	text:'提醒发药',
			        	plain:true,
			        	iconCls:'icon-check'
			        });
			        
			        var start = 0;
					var end = 0;
					var mer = ['drug_number','clinic_name','drug_name','kucun','sate'];//需要合并的字段，即field
					//有数据就合并----对应数据的数量
					if (data.total > 0){
					    var temp = data.rows[0].drug_number;   //需要比较的列-----排班类型----门诊还是住院
					    for (var i = 1; i < data.rows.length; i++) {
						    //第一列的门诊或住院类型=遍历过程中的门诊或住院
							if (temp == data.rows[i].drug_number) {
							     end++;
							} else {
							    if (end> start) {
									for(var j = 0; j < mer.length; j ++){
										$("#notexecute_advice_dg").datagrid('mergeCells', {
											index: start,//起始索引
											rowspan: end - start + 1,  //需要合并的行数
											field: mer[j]
										});
									}
							   }
							    temp = data.rows[i].drug_number;
							    start = i;
							    end = i;
						 }
					 }
					    //这里是为了判断重复内容出现在最后的情况
					    if (end > start) {
							for(var j = 0; j < mer.length; j ++){
								$("#notexecute_advice_dg").datagrid('mergeCells', {
									index: start,
									rowspan: end - start + 1,
									field: mer[j]
								});
							}
					    }
					}/* 最大if结束 */
			    }  
			});
			
			//执行医嘱的确定按钮
			$("#add_adv_comfrim").click(function(){
				$("#illness-for").form({
				    url:'add-illnessrecord',
				    onSubmit: function(){
				    },
				    success:function(data){
				    	$.messager.show({
	                        title:'提示信息' , 
	                        msg:'执行医嘱完成！请及时查查病程记录！'
	                    });
				    	//$("#illness-for").form("clear");//清空文本
				    	$("#notexecute_advice_dg").datagrid("reload");
				    	$("#overadv-dg").datagrid("reload");
				    	$("#overops-advice-win").window("close");
				    }
				}).submit();
			});
			
			//已执行的医嘱形成的病程记录
			$("#overadv-dg").datagrid({
			    url:'init-nessrecord',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:6,
      		    pageList:[6,12],
			    columns:[[
			    	{field:'ill_id',title:'编号',width:40,checkbox:true},
					{field:'docdetails_id',title:'编号',width:60},
					{field:'clinic_name',title:'病人名称',width:80},
					{field:'clinic_sex',title:'性别',width:60},
					{field:'day_id',title:'编号',width:60,hidden:true},
					{field:'drug_name',title:'药物名称',width:130},
					{field:'docdetails_everynnum',title:'药品数量',width:60,
						styler: function(value,row,index){
							return 'color:#AA33B6;font-weight:bold;';
						}
					},
					{field:'drug_purchase_price',title:'药品单价',width:80},
					{field:'type_name',title:'药品类型',width:80},
					{field:'ill_hz',title:'药物用量',width:80,
						styler: function(value,row,index){
							return 'color:#AA33B6;';
						}
					},
					{field:'subtotal',title:'药品总价',width:70,
						formatter:function(value,row,index){
							 var count = row.docdetails_everynnum
							 var price = row.drug_purchase_price
							 var subtotal = parseFloat(price)*parseInt(count);
	   						 return subtotal;
						}
					},
					{field:'subtotals',title:'实际小计',width:70,
						formatter:function(value,row,index){
							 var count = row.ill_hz
							 var price = row.drug_purchase_price
							 var subtotals = parseFloat(price)*parseInt(count);
	   						 return subtotals;
						},
						styler: function(value,row,index){
							return 'color:red;';
						}
					},
					{field:'ill_operator',title:'执行人',width:80},
					{field:'ill_time',formatter:comFormatDate,title:'执行时间',width:170}
			    ]]
			});
			
			//查询当天的病程记录
			$("#intraday").click(function(){
				$("#overadv-dg").datagrid({
				    url:'select-intraday',
				    pagination:true,
	      		    pageNumber:1,
	      		    pageSize:6,
	      		    pageList:[6,12],
				    columns:[[
				    	{field:'ill_id',title:'编号',width:40,checkbox:true},
						{field:'docdetails_id',title:'编号',width:60},
						{field:'clinic_name',title:'病人名称',width:80},
						{field:'clinic_sex',title:'性别',width:60},
						{field:'day_id',title:'编号',width:60,hidden:true},
						{field:'drug_name',title:'药物名称',width:130},
						{field:'docdetails_everynnum',title:'药品数量',width:60},
						{field:'drug_purchase_price',title:'药品单价',width:80},
						{field:'type_name',title:'药品类型',width:80},
						{field:'ill_hz',title:'药物用量',width:80,
							styler: function(value,row,index){
								return 'color:red;';
							}
						},
						{field:'subtotal',title:'药品总价',width:70,
							formatter:function(value,row,index){
								 var count = row.docdetails_everynnum
								 var price = row.drug_purchase_price
								 var subtotal = parseFloat(price)*parseInt(count);
		   						 return subtotal;
							}
						},
						{field:'subtotals',title:'实际小计',width:70,
							formatter:function(value,row,index){
								 var count = row.ill_hz
								 var price = row.drug_purchase_price
								 var subtotals = parseFloat(price)*parseInt(count);
		   						 return subtotals;
							},
							styler: function(value,row,index){
								return 'color:red;';
							}
						},
						{field:'ill_operator',title:'执行人',width:80},
						{field:'ill_time',formatter:comFormatDate,title:'执行时间',width:170}
				    ]]
				});
			});
			
			//设置未执行的颜色
			$("#overadv-dg").datagrid({
				rowStyler:function(index,row){
					if (row.day_id==null){
						return 'background-color:#C8E0EF;font-weight:bold;';
					}
				}
			});
			
			
			//生成日结单
			$("#addday").click(function(){
				var rows =$("#overadv-dg").datagrid('getSelected');
				if(rows == null){
					$.messager.confirm('Confirm', 
							'未选中行，请选择行', 
							function(r){
					});
				}
				
				var dayOpreator=$("#people").val();
	            //总金额
				var	drugtotal=null;
	            var arr = [];
				for (var i = 0; i < rows.length; i++) {
					arr.push(rows[i]['ill_id']);
					drugtotal +=parseFloat(rows[i]["drug_purchase_price"])*parseInt(rows[i]["ill_drugcount"]); 
				}			
				$.ajax({
					url:'addpay-day?arr='+arr+'&drugtotal='+drugtotal+'&dayOpreator='+dayOpreator,
					Type:'json',
					method:'Post',
					success:function(data){
						$("#overadv-dg").datagrid("reload");
					}
				});
				//清除选项
				$("#overadv-dg").datagrid('clearChecked');
				
			});
			
			//床位表的信息
			$('#bed-dg').datagrid({
			    url:'init-bedno',
			    columns:[[
					{field:'section_name',title:'科室',width:88},
					{field:'sickroom_name',title:'病房号',width:95},
					{field:'bed_no',title:'床位号',width:60},
					{field:'bed_state',title:'是否有人',width:75,
						formatter:function(value,row,index){
							if(value==0){
								return "空床";
							}
						}
					},
					{field:'bed_money',title:'租金',width:80}
			    ]]
			});
			
			
			//床位初始化
			$('#change-bed').combobox({   
	         	//url:'init-bedno',//数据源
	         	valueField: 'bed_id',//实体类名字---主键id
		        textField: 'bed_no',//需要显示在下拉框的实际内容
		        editable:false,
	            panelHeight:'auto',//高度根据内容自动定
	            onLoadSuccess: function () {  //加载完成后,设置选中第一项
	                    var val = $(this).combobox("getData");
	                    for (var item in val[0]) {
	                        if (item == "bed_id") {
	                        	//初始化数据默认选中第一个
	                            $(this).combobox("select", val[0][item]);
	                        }
	                    }
	             }
 
	         });
			
			
			//新增床位中的科室初始化
			$('#addsection').combobox({   
	         	url:'init-sectionAll',//数据源
	         	valueField: 'section_id',//实体类名字---主键id
		        textField: 'section_name',//需要显示在下拉框的实际内容
		        editable:false,
	            panelHeight:'auto',//高度根据内容自动定
	            onLoadSuccess: function () {  //加载完成后,设置选中第一项
                    var val = $(this).combobox("getData");
                    for (var item in val[0]) {
                        if (item == "section_id") {
                        	//初始化数据默认选中第一个
                            $(this).combobox("select", val[0][item]);
                        }
                    }
               },
               onSelect:function(row){
            	   $('#addroom').combobox({
						 url: "init-sickroom?sid="+row['section_id'],
						 valueField: 'sickroom_id',//实体类名字---主键id
					     textField: 'sickroom_name',//需要显示在下拉框的实际内容	
					     onLoadSuccess: function () {  //加载完成后,设置选中第一项
			                    var val = $(this).combobox("getData");
			                    for (var item in val[0]) {
			                        if (item == "sickroom_id") {
			                        	//初始化数据默认选中第一个
			                            $(this).combobox("select", val[0][item]);
			                        }
			                    }
			             }
						 
            	   });
                }
	         });
			
			
			//新增床位
			$("#addbed").click(function(){
				$("#add-bed-win").window("open");
			});
			
			//新增床位的确定按钮
			$("#addbed-comfirm").click(function(){
				$("#addbed-for").form({
				    url:'add-bed',
				    onSubmit: function(){
				    },
				    success:function(data){
				    	$('#bed-dg').datagrid('reload');//新增之后会刷新
				    	$("#addbed-for").form("clear");//清空文本
				    	$("#add-bed-win").window("close");
				    }
				}).submit();
			});
			
			
			
			//所搜住院号查询之前的床位号
			$("#bedhospid_sercher").searchbox({
				searcher:function(value,name){
					$("#bedhospid-record-win").window("open");
				}

			});
			
			//双击获取住院号
			$("#bedhosprecord-dg").datagrid({
				onDblClickRow: function(rowIndex,rowData){
					//住院号
                    $("#bedhospid_sercher").textbox('setValue',rowData.hosp_id);
					
                    $("#office").textbox('setValue',rowData.section_name);
                    //病房初始化
        			$('#change-room').combobox({   
   					    url: "init-sickroombed?sid="+rowData.section_id,
        	         	valueField: 'sickroom_id',//实体类名字---主键id
        		        textField: 'sickroom_name',//需要显示在下拉框的实际内容
        		        editable:false,
        	            panelHeight:'auto',//高度根据内容自动定
        	            onHidePanel: function(){
        	            	//床位号的下拉列表
        				     $("#change-bed").combobox("setValue",'');
	        				     var roomid = $('#change-room').combobox('getValue'); 
	        					 $.ajax({
	        					 type: "Post",
	        					 url: "select-roombedno?roomid="+roomid,
	        					 cache: false,
	        					 dataType : "json",
	        					 success: function(data){
	        						 $("#change-bed").combobox("loadData",data);
	        						 }
	        					 }); 
        				  }
        	        });
        			
					//原来的床位主键
					$("#old_bedid").textbox('setValue',rowData.bed_id);
					//原床位号
                    $("#old_bedno").textbox('setValue',rowData.bed_no);
                    //病人姓名
                    $("#name_input").textbox('setValue',rowData.clinic_name);
                    
                    $("#bedhospid-record-win").window("close");
				}
				
			});
			
			//住院表的信息[调整床位的信息]
			$("#bedhosprecord-dg").datagrid({
			    url:'reg-hosprecord',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:10,
      		    pageList:[10,15],
			    columns:[[
			    	{field:'hosp_id',title:'住院号',width:100},
			    	{field:'section_name',title:'科室',width:80},
			    	{field:'section_id',title:'科室编号',width:80},
					{field:'clinic_name',title:'病人姓名',width:80},
					{field:'clinic_sex',title:'性别',width:80},
					{field:'clinic_age',title:'年龄',width:60},
					{field:'bed_id',title:'床位编号',width:100,hidden:true},
					{field:'bed_no',title:'床位号',width:80}
			    ]]
			});
			
			//床位的确定按钮
			$("#bed-comfirm").click(function(){
				$('#changebed-for').form({
				    url:'add-changebed',
				    onSubmit: function(){
				    },
				    success:function(data){
				    	$.messager.confirm('Confirm', 
								'新床位租金已扣除，请及时查看押金余额', 
								function(r){	
						});
				    	$('#changebed-for').form("clear");//清空文本
				    	$("#bed-changebed-record-dg").datagrid('reload');
				    	$("#bed-dg").datagrid('reload');
				    }
				}).submit();
			});
			
			//清空按钮
			$("#bed-colse").click(function(){
				//清除文本框
		    	$('#changebed-for').form('clear');
			});
			
			//床位登记记录
			$("#bed-changebed-record-dg").datagrid({
			    url:'init-bedrecord',
			    pagination:true,
	      		pageNumber:1,
	      		pageSize:5,
	      		pageList:[5,10,15,20],
			    columns:[[
			    	{field:'hosp_id',title:'住院号',width:90},
					{field:'clinic_name',title:'病人姓名',width:90},
					{field:'clinic_sex',title:'性别',width:60},
					{field:'bed_no',title:'床位号',width:70},
					{field:'bed_money',title:'每日租金',width:60},
					{field:'days',title:'住院天数',width:80,
						formatter:function(value,row,index){
				              if(value==0){
				            	  return "今天住院";
				              }else if(value!=0){
				            	  return value+" 天";
				              }
				              
						},
						styler: function(value,row,index){
							return 'color:red;';
						}
					},
					{field:'zbedmoney',title:'床位租金费用',width:100,
						formatter:function(value,row,index){
				              if(value==0){
				            	  return "已扣除租金";
				              }else if(value!=0){
				            	  return value;
				              }
				              
						},
						styler: function(value,row,index){
							return 'color:red;';
						}
					},
					{field:'bedchange_people',title:'经办人',width:126,
						formatter:function(value,row,index){
			              if(value==null){
			            	  return "暂无调整床位";
			              }else{
			            	  return value;
			              }
						},
						styler: function(value,row,index){
							if (value == null){
								return 'background-color:#ffee00;color:red;';
							}
						}
					},
					{field:'bedchange_time',formatter:comFormatDate,title:'时间',width:190},
					{field:'mops',title:'操作',width:142,
						 formatter:function(value,row,index){
				                var btn ='<a id="ops-btn" class="aa changebed easyui-linkbutton" onclick="changebedrecord(\''+row.hosp_id+'\')" href="javascript:void(0)">调整记录</a>';
								return btn;
							} 
	   				   
	   				   }
			    ]],
			    onLoadSuccess:function(data){
			        $('.changebed').linkbutton({
			        	text:'调整记录',
			        	plain:true,
			        	iconCls:'icon-check'
			        }); 
			    }  
		   });
			
			
			$("#bed-cname").searchbox({
				searcher:function(value,name){
					$("#bed-changebed-record-dg").datagrid({
						 url:'init-bedrecord',
						 queryParams:{
							 sickname:value
						    },
						    pagination:true,
				      		pageNumber:1,
				      		pageSize:5,
				      		pageList:[5,10,15,20],
						    columns:[[
						    	{field:'hosp_id',title:'住院号',width:100},
								{field:'clinic_name',title:'病人姓名',width:90},
								{field:'clinic_sex',title:'性别',width:60},
								{field:'bed_no',title:'床位号',width:100},
								{field:'bed_money',title:'每日租金',width:60},
								{field:'days',title:'住院天数',width:90,
									formatter:function(value,row,index){
							              if(value==0){
							            	  return "今天住院";
							              }else if(value!=0){
							            	  return value+" 天";
							              }
							              
									},
									styler: function(value,row,index){
										return 'color:red;';
									}
								},
								{field:'zbedmoney',title:'床位租金费用',width:100,
									formatter:function(value,row,index){
							              if(value==0){
							            	  return "已扣除租金";
							              }else if(value!=0){
							            	  return value;
							              }
							              
									},
									styler: function(value,row,index){
										return 'color:red;';
									}
								},
								{field:'bedchange_people',title:'经办人',width:136,
									formatter:function(value,row,index){
						              if(value==null){
						            	  return "暂无调整床位";
						              }else{
						            	  return value;
						              }
									},
									styler: function(value,row,index){
										if (value == null){
											return 'background-color:#ffee00;color:red;';
										}
									}
								},
								{field:'bedchange_time',formatter:comFormatDate,title:'调整时间',width:150},
								{field:'mops',title:'操作',width:150,
									 formatter:function(value,row,index){
							                var btn ='<a id="ops-btn" class="aa changebed easyui-linkbutton" onclick="changebedrecord(\''+row.hosp_id+'\')" href="javascript:void(0)">调整记录</a>';
											return btn;
										} 
				   				   
				   				   }
						    ]],
						    onLoadSuccess:function(data){
						        $('.changebed').linkbutton({
						        	text:'调整记录',
						        	plain:true,
						        	iconCls:'icon-check'
						        }); 
						    }  
					   });
				}
        	
        	});
			
			
		  //根据姓名查询病程记录
		   $("#selectillnessrecord").searchbox({
				searcher:function(value,name){
					$("#overadv-dg").datagrid({
						    url:'init-nessrecord',
						    queryParams:{
								 cname:value
							},
						    pagination:true,
			      		    pageNumber:1,
			      		    pageSize:6,
			      		    pageList:[6,12],
						    columns:[[
						    	{field:'ill_id',title:'编号',width:40,checkbox:true},
								{field:'docdetails_id',title:'编号',width:60},
								{field:'clinic_name',title:'病人名称',width:80},
								{field:'clinic_sex',title:'性别',width:60},
								{field:'day_id',title:'编号',width:60,hidden:true},
								{field:'drug_name',title:'药物名称',width:130},
								{field:'docdetails_everynnum',title:'药品数量',width:60},
								{field:'drug_purchase_price',title:'药品单价',width:80},
								{field:'type_name',title:'药品类型',width:80},
								{field:'ill_hz',title:'药物用量',width:80,
									styler: function(value,row,index){
										return 'color:red;';
									}
								},
								{field:'subtotal',title:'药品总价',width:70,
									formatter:function(value,row,index){
										 var count = row.docdetails_everynnum
										 var price = row.drug_purchase_price
										 var subtotal = parseFloat(price)*parseInt(count);
				   						 return subtotal;
									}
								},
								{field:'subtotals',title:'实际小计',width:70,
									formatter:function(value,row,index){
										 var count = row.ill_hz
										 var price = row.drug_purchase_price
										 var subtotals = parseFloat(price)*parseInt(count);
				   						 return subtotals;
									},
									styler: function(value,row,index){
										return 'color:red;';
									}
								},
								{field:'ill_operator',title:'执行人',width:80},
								{field:'ill_time',formatter:comFormatDate,title:'执行时间',width:170}
						    ]]
						});
				}
		  });
		 
			
	
	  });
		
		//根据病人姓名，主治医生，药品查询
		 function notadvicesearcher(value,name){
		    	var drugname="";
				var cname="";
				var doctorname="";
				if(name=="姓名查询"){
					cname=value;
				}else if(name=="主治医生查询"){
					doctorname = value;
				}else if(name=="药品名称查询"){
					drugname = value;
				}
			    $("#notexecute_advice_dg").datagrid({
				    url:'find-notadviceall',
				    queryParams:{
				    	clinicname:cname,
				    	doctorname:doctorname,
				    	drugname:drugname
				    },
				    method:'Post',
				    pagination:true,
	      		    pageNumber:1,
	      		    pageSize:10,
	      		    pageList:[10,20],
				    columns:[[
				    	{field:'docdetails_id',title:'处方编号',width:75},
				    	{field:'hosp_id',title:'住院号',width:100,hidden:true},
				    	{field:'clinic_name',title:'病人姓名',width:75},
				    	{field:'user_name',title:'主治医生',width:90},
						{field:'drug_name',title:'药物名称',width:130},
						{field:'drug_purchase_price',title:'价格',width:60},
						{field:'docdetails_everynnum',title:'领药药品数量',width:90},
						{field:'docdetails_hz',title:'药品用量',width:140,
							formatter:function(value,row,index){
								 return "一天  "+value+" 瓶";
		   					},
							styler: function(value,row,index){
								return 'color:blue;font-weight:bold;';
						    }
		   				},
						{field:'type_name',title:'类别',width:80},
				    	{field:'drug_number',title:'药物编号',width:150,hidden:true},
						{field:'kucun',title:'库存',width:90,
							styler: function(value,row,index){
								return 'color:red;';
							},
							formatter:kucuns
						},
						{field:'sate',title:'状态',width:90,
							formatter:function(value,row,index){
								if(row.kucun==0){
									 return "待发药";
								}else if(row.kucun !=0){
									return "库存充足";
								}  
		   					},
							styler: function(value,row,index){
								if(row.kucun==0){
									return 'color:red;';
								}
							}
						},
						{field:'publicdurg_type',title:'发药编号',width:150,hidden:true},
						{field:'pd_details_sjcount',title:'实际发药数量',width:90,hidden:true},
						{field:'mops',title:'操作',width:128,
	   					   formatter:function(value,row,index){
	   						   if(row.kucun==0){
	   							   var btn ='<a class="tixing" onclick="remind()" href="javascript:void(0)">提醒发药</a>';
	     						   return btn;
	   						   }else if(row.kucun != 0){
	   							   var btn ='<a class="detials" onclick="executeadice(\''+row.docdetails_id+'\',\''+row.hosp_id+'\',\''+row.clinic_name+'\',\''+row.user_name+'\',\''+row.docdetails_everynnum+'\',\''+row.kucun+'\',\''+row.drug_number+'\')" href="javascript:void(0)">执行</a>';
	     						   return btn;
	   						   }
				              
	   					   } 
		   				}
				    ]],
					onLoadSuccess:function(data){
				        $('.detials').linkbutton({
				        	text:'执行',
				        	plain:true,
				        	iconCls:'icon-edit'
				        });
				        
				        $('.tixing').linkbutton({
				        	text:'提醒发药',
				        	plain:true,
				        	iconCls:'icon-check'
				        });
				        
				        var start = 0;
						var end = 0;
						var mer = ['drug_number','clinic_name','drug_name','kucun','sate'];//需要合并的字段，即field
						//有数据就合并----对应数据的数量
						if (data.total > 0){
						    var temp = data.rows[0].drug_number;   //需要比较的列-----排班类型----门诊还是住院
						    for (var i = 1; i < data.rows.length; i++) {
							    //第一列的门诊或住院类型=遍历过程中的门诊或住院
								if (temp == data.rows[i].drug_number) {
								     end++;
								} else {
								    if (end> start) {
										for(var j = 0; j < mer.length; j ++){
											$("#notexecute_advice_dg").datagrid('mergeCells', {
												index: start,//起始索引
												rowspan: end - start + 1,  //需要合并的行数
												field: mer[j]
											});
										}
								   }
								    temp = data.rows[i].drug_number;
								    start = i;
								    end = i;
							 }
						 }
						    //这里是为了判断重复内容出现在最后的情况
						    if (end > start) {
								for(var j = 0; j < mer.length; j ++){
									$("#notexecute_advice_dg").datagrid('mergeCells', {
										index: start,
										rowspan: end - start + 1,
										field: mer[j]
									});
								}
						    }
						}/* 最大if结束 */
				    }  
				});
		    }
		    
		
		//提醒发药的提示信息
		function remind(){
			$.messager.confirm('Confirm', 
					'请去药房拿药', 
					function(r){
			});
		}
		
		//执行医嘱的窗口
		function executeadice(docdetails_id,hosp_id,clinic_name,user_name,docdetails_everynnum,kucun,drug_number){
			$("#overops-advice-win").window("open");
			//获取医嘱编号
			$("#details_id").textbox('setValue',docdetails_id);
			$("#details_id").next().hide();
			//库存数量
			$("#kucun").textbox('setValue',kucun);
			$("#kucun").next().hide();
			//获取住院号
			$("#hosp_id").textbox('setValue',hosp_id);
			//病人姓名
			$("#sick_name").textbox('setValue',clinic_name);
			//主治医生
			$("#doc_input").textbox('setValue',user_name);
			//药品数量
			$("#drugcount").textbox('setValue',docdetails_everynnum);
			//药品编号drug_number
			$("#drug_no").textbox('setValue',drug_number);
			$("#drug_no").next().hide();
		};
		
		//调整床位信息的窗口
		function changebedrecord(hosp_id){
			$("#adjust-bed-win").window("open");
			//调整床位的信息记录
			$("#adjust-bed-record-tab").datagrid({
			    url:'find-changebedrecord',
			    queryParams:{
			    	hospid:hosp_id
			    },
			    columns:[[
			    	{field:'hosp_id',title:'住院号',width:90},
					{field:'clinic_name',title:'病人姓名',width:80},
					{field:'clinic_sex',title:'性别',width:50},
					{field:'bed_no',title:'旧床位号',width:80},
					{field:'oldbedmoney',title:'租金',width:50},
					{field:'bed_state',title:'状态',width:50,
						formatter:function(value,row,index){
							if(value==2){
								return "空床";
							}
						}
					},
					{field:'bedchange_time',formatter:comFormatDate,title:'调整时间',width:140},
					{field:'bedchange_people',title:'经办人',width:73}
					
			    ]]
			});
			 
		}    
		
		

		
		function comFormatDate(date) {
			var day = new Date(date); 
			var Year = 0; 
			var Month = 0; 
			var Day = 0; 
			var CurrentDate = ""; 
			//初始化时间 
			Year= day.getFullYear();
			Month= day.getMonth()+1; 
			Day = day.getDate(); 
			Hour = day.getHours(); 
			 Minute = day.getMinutes(); 
			 Second = day.getSeconds(); 
			CurrentDate += Year + "-"; 
			if (Month >= 10 ) { 
				CurrentDate += Month + "-"; 
			}else { 
				CurrentDate += "0" + Month + "-"; 
			} 
			if (Day >= 10 ) { 
				CurrentDate += Day ; 
			}else { 
				CurrentDate += "0" + Day ; 
			} 
			if(Hour>=10){
				CurrentDate +=" "+Hour;
			}else{
				CurrentDate +=" "+"0"+Hour;
			}
			if(Minute>=10){
				CurrentDate +=":"+Minute;
			}else{
				CurrentDate +=":"+"0"+Minute;
			}
			if(Second>=10){
				CurrentDate +=":"+Second;
			}else{
				CurrentDate +=":"+"0"+Second;
			}
			return CurrentDate; 
		}
	</script>
	<!-- 选项卡 -->
	<div id="nurse-tt" class="easyui-tabs">
	    <div title="申请领药单" style="padding:10px;display:none;">
			<!--  领药信息 -->
			<fieldset style="border:1px solid #A6A6A6;border-radius:6px;height:430px;width:1050px;margin: 0px auto;">
				<legend>申请领药信息</legend>
				 <div style="font-size: 14px;margin-bottom:10px;margin-top: 10px;">
			        <a id="addapplydurg" style="margin-left:20px;width:100px;" iconCls="icon-help" class="easyui-linkbutton">领药</a>
					<a style="margin-left:25px;">
						<span style="margin-right:7px;">经办人</span>
						<input id="apply-nurseuname" value="${user.userName}" name="out-nurseuname" class="easyui-textbox"  data-options="width:140,height:30,required:true">
					</a>
     		 	</div>
				<div class="nurse-drug" style="margin-top: 10px;">
					<table id="recipe-dg" data-bind="datagrid:grid" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:false"style="height:300px;">
					
					</table>
				</div>
				<p>
				<span  style="margin-left: 50px;font-size:18px;">总数量：</span>
			    <input id="totalcount" class="easyui-textbox" readonly style="font-size:20px;" data-options="value:0,width:130,height:35">
				
				<span  style="margin-left: 50px;font-size:18px;color:red;">
				          总金额：￥
				</span>
			    <input id="totalmoney" class="easyui-textbox" readonly style="font-size:20px;" data-options="value:0,width:130,height:35">
				<a id="apply-drug-comfirm" class="easyui-linkbutton" iconCls="icon-ok" style="width:150px;height:30px;margin-left: 80px;">确定</a>
				
				</p>
			</fieldset>
			
			
	    </div>
	    
	    <div title="执行医嘱" data-options="closable:false" style="overflow:auto;display:none;">
    		 <fieldset style="border:1px solid #A6A6A6;border-radius:6px;width:1050px;height:390px;margin: 15px auto;">
		    	<legend>未执行的医嘱</legend>
		    	<!-- 搜索框 -->
				<input id="nurseadvice" class="easyui-searchbox" style="width:300px"
				    data-options="searcher:notadvicesearcher,prompt:'Please Input Value',menu:'#nurse-advicediv'"></input>
				<div id="nurse-advicediv" style="width:120px">
				    <div data-options="iconCls:'icon-ok'">姓名查询</div>
				    <div data-options="iconCls:'icon-ok'">主治医生查询</div>
				    <div data-options="iconCls:'icon-ok'">药品名称查询</div>
				</div>
			    <table id="notexecute_advice_dg" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:true"style="height:350px;">
				</table>
		    </fieldset>
			<fieldset style="border:1px solid #A6A6A6;border-radius:6px;width:1050px;height:420px;margin: 15px auto;">
		    	<legend>病程记录</legend>
		    	<p>
		    		<a>输入姓名查询：<input id="selectillnessrecord"  class="easyui-searchbox" style="width:140px;height:30px;"></a>
		    	</p>
		    	<input id="people" type="hidden" class="easyui-textbox" value="${user.userName}"/> 
			    <table id="overadv-dg" class="easyui-datagrid" data-options="toolbar:'#day-open-tb',fitColumns:false,singleSelect:false"style="height:320px;">
				</table>
		    </fieldset>
			
	    </div>
	    <!-- 工具栏 -->
		<div id="day-open-tb">
			<a href="#" id="addday" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">生成日结单</a>
			<a href="#" style="width:120px;float:right;" id="intraday" class="easyui-linkbutton" iconCls="icon-check">查询当天记录</a>
		
		</div>
	    <div title="调整床位" data-options="closable:false" style="padding:20px;display:none;">
	    	<!-- 床位的信息 -->
    		<fieldset style="border:1px solid #A6A6A6;border-radius:6px;margin-left:30px;margin-bottom:20px;width:300px;height:380px;float:left;">
		    	<legend>床位信息</legend>
		    	<a id="addbed" style="width:100px;margin-left: 300px;" class="easyui-linkbutton" iconCls="icon-check">新增床位</a>
		    	<!-- 床位表的数据 -->
			    <table id="bed-dg" style="height:330px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:false">
				</table>
		    </fieldset>
	    	
	    	<!-- 调整床位信息 -->
    		<fieldset style="border:1px solid #A6A6A6;border-radius:6px;margin-bottom:20px;margin-left:15px;float:left;width:600px;height:380px;">
		    	<legend>调整床位信息</legend>
		    	<form id="changebed-for" method="Post">
						<p style="margin-top: 20px;">
							<a style="margin-left: 35px;">
							<input id="bedhospid_sercher" name="hospId" class="easyui-searchbox" data-options="label:'住院号',height:30" style="width:230px"></a> 
				    		<a style="margin-left: 30px;"><input id="name_input" class="easyui-textbox" data-options="label:'病人姓名',height:30" style="width:230px"></a>
						</p>
						<p style="margin-top: 30px;">	
							<input id="old_bedid" type="hidden" name="bedId" class="easyui-textbox">	
							<a style="margin-left: 28px;">
								<input id="office" class="easyui-textbox" data-options="label:'科室',height:30,required:true" style="width:230px">
							</a>
							<a style="margin-left: 30px;">
							 <select id="change-room" name="roomId"  class="easyui-combobox" data-options="label:'病房号',height:30,required:true" style="width:230px">
					         </select>	
							</a>
						</p>
						<p style="margin-top: 30px;">	
							<input id="old_bedid" type="hidden" name="bedId" class="easyui-textbox">	
							<a style="margin-left: 28px;">
								<input id="old_bedno" class="easyui-textbox" data-options="label:'原床位号',height:30,required:true" style="width:230px">
							</a>
							<a style="margin-left: 30px;">
							 <select id="change-bed" name="bedNo"  class="easyui-combobox" data-options="label:'新床位号',height:30,required:true" style="width:230px">
					         </select>	
							</a>
						</p>
						
						<p style="margin-top: 30px;">	
						   <a style="margin-left: 35px;">
							<input class="easyui-textbox" name="bedchangePeople" data-options="label:'操作员',height:30,readonly:true" value="${user.userName}" style="width:230px">
							</a>			
							<a style="margin-left: 30px;">
							<input id="overtime" class="easyui-datetimebox" data-options="label:'调整时间',height:30,required:true" style="width:230px">
							</a>
							
						</p>
						
					 <p style="margin-top: 20px;">
					 <a id="bed-comfirm" class="easyui-linkbutton" iconCls="icon-ok" style="width:100px;margin-left: 30px;margin-top: 20px;height:35px;border-radius:6px;">确定</a>
					 <a id="bed-colse" style="width:100px;margin-left: 30px;margin-top: 20px;height:35px;border-radius:6px;" class="easyui-linkbutton" iconCls="icon-no">清空</a>
					 
					 </p>
		    	</form>
		    </fieldset>
			
		    <!-- 床位记录 -->
    		<fieldset style="border:1px solid #A6A6A6;border-radius:6px;margin-top:5px;margin-left:30px;width:1040px;height:480px;">
		    	<legend>床位记录信息</legend>
		    	<!-- 床位表和床位变化表的数据 -->
		    	<p>
		    		<a>输入姓名查询：<input id="bed-cname"  class="easyui-searchbox" style="width:140px;height:30px;"></a>
		    	</p>
			    <table id="bed-changebed-record-dg" style="margin-top: 5px;height:370px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:false">
				</table>
		    </fieldset>
		    
	    </div>
	</div>
	
	
	
	<!-- 执行医嘱的窗口 -->
	<div id="overops-advice-win" class="easyui-window" title="执行医嘱" style="width:640px;height:400px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<!-- 已执行的医嘱 -->
		<form id="illness-for" method="post">
			<div class="adving-adv-mess" style="padding:10px;">
		    	<p style="margin-top: 30px;">
					<a>
					<!-- label:'医嘱编号' -->
					<input id="details_id" name="docdetailsId" class="easyui-textbox" data-options="" >
					<input id="drug_no" name="drugno" class="easyui-textbox" data-options="" >
					<input id="kucun" name="samallkucun" class="easyui-textbox" data-options="" ></a>
					<a style="margin-left: 50px;">
					<input id="hosp_id" name="hospId" class="easyui-textbox" data-options="label:'住院号',readonly:true" style="width:200px"></a>
					<a style="margin-left: 60px;">
					<input id="sick_name" class="easyui-textbox" data-options="label:'病人姓名',readonly:true,required:true" style="width:200px"></a>  		
				</p>
				
				<p style="margin-top: 30px;">
					<a style="margin-left: 50px;">
						<input id="doc_input" class="easyui-textbox" data-options="label:'主治医生',readonly:true" style="width:200px">
					</a>
				   <a style="margin-left: 60px;">
				   <input id="ops_people" name="illOperator" class="easyui-textbox"  data-options="label:'执行人',required:true,readonly:true" value="${user.userName}" style="width:200px"></a>
		
				</p>
				<p style="margin-top: 30px;">
					<a style="margin-left: 50px;">
						<input id="drugcount" name="illDrugcount" class="easyui-textbox" data-options="label:'药品数量'" style="width:200px">
					</a>
					<a style="margin-left: 60px;">
						<input class="easyui-textbox" name="illHz" data-options="label:'药物用量'" style="width:200px">
					</a>
					
				</p>
				<p style="margin-top: 20px;">
		    		<a id="add_adv_comfrim" class="easyui-linkbutton" style="width:120px;margin:30px 220px;" iconCls="icon-ok">确定</a>
				</p>
	
			</div>
		</form>
		
	</div>

	<!-- 调整床位的信息-->
	<div id="adjust-bed-win" class="easyui-window" title="调整床位记录" style="width:630px;height:400px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<table id="adjust-bed-record-tab" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:false" style="height:350px;">
		</table>
	</div>
	
	<!-- 新增床位的窗口 -->
	<div id="add-bed-win" class="easyui-window" title="新增床位" style="width:390px;height:300px"
		    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		 <div style="width:250px;height:170px;margin: 0px auto;text-align: center;">
			 <form method="post" id="addbed-for">
			 	<p><input id="bed_no" name="bedNo" class="easyui-textbox" data-options="label:'床位号',height:30,required:true" style="width:200px"></p>
			 	<p style="margin-top: 20px;"><input name="bedMoney" class="easyui-textbox"  data-options="label:'租金',height:30,required:true" style="width:200px"></p>
			 	<p style="margin-top: 20px;"> 
			 	  <select id="addsection" name="sectionId" class="easyui-combobox" data-options="label:'科室名称',height:30" style="width:200px">
				  </select>
			    </p>
			 	<p style="margin-top: 20px;"> 
			 	  <select id="addroom" name="sickroomName" class="easyui-combobox" data-options="label:'病房名称',height:30" style="width:200px">
				  </select>
			    </p>
			 	<p style="margin-top: 20px;"><a id="addbed-comfirm" style="width:100px;height:30px;" class="easyui-linkbutton" iconCls="icon-ok">确定</a></p>
			 </form>  
		 </div>
	</div>
	
	<!-- 所搜住院号的窗口 -->
	<div id="bedhospid-record-win" class="easyui-window" title="住院的信息(调整床位)" style="width:580px;height:430px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<table id="bedhosprecord-dg" style="height:360px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:false">
		</table>
	</div>
	
	<!-- 弹框提示 
    <div id="warmingapplydurg-win" class="easyui-window"  title="提示框" style="width:300px;height:156px"
    data-options="iconCls:'icon-save',modal:true,resizable:false,collapsible:false,maximizable:false,minimizable:false,closed:true">
          <p class="window-applydrug" style=" margin-left: 72px;font-size: 16px;margin-top: 47px;">
          </p>
    </div> -->
</body>
</html>